package com.blex.misp.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.hibernate.Criteria;
import org.hibernate.criterion.Criterion;

public interface HibernateDao<T> {
	
	public void save(T entity);
	
	public void update(T entity);
	
	public void delete(T entity);
	
	public void deleteById(Serializable id);
	
	public T get(Serializable id);
	
	public List<T> findAll();
	
	public List<T> findAll(int page, int rows, String sort, String order);
	
	public int countAll();
	
	public T get(String hql);
	
	public T get(String hql, Map<String, Object> propertys);
	
	public List<T> find(String hql);
	
	public List<T> find(String hql, Map<String, Object> params);
	
	public List<T> findByProperty(String propertyName, Object value);
	
	public boolean isExist(String propertyName, Object value);
	
	public Criteria createCriteria(Criterion... criterions);

}
